package com.wlcorp.forcazamis.domain.stock;

import java.util.Date;

import com.wlcorp.forcazamis.domain.baseinfo.Factory;
import com.wlcorp.forcazamis.domain.confirm.Confirm;
import com.wlcorp.forcazamis.domain.system.Staff;
import com.wlcorp.forcazamis.sys.BaseBean;
import com.wlcorp.forcazamis.sys.util.AppConstant;

public class Stock extends BaseBean{
	private static final long serialVersionUID = 4142766045226569297L;
	private Long stockId;
	private String stockCode;// 合同编号
	private Integer stockLevel;// 合同类型(新单,翻单)
	private String stockType;// 订单类型(T:特级订单 AA:非常紧急 A:一般紧急 B:正常生产 C:较长生产
	// D:超长生产)
	private Date stockDate;//下单日期
	private Factory factory;// 供应商(供应商编号、供应商联系人、供应商名称)
	private String deliveryDate;// 交货日期

	private Long createdBy;
	private Staff creator;
	private Date createdDate;
	private Long modifiedBy;
	private Staff modifier;
	private Date modifiedDate;
	private Long confirmId;
	private Confirm confirm;
	private Integer state;// 合同状态(1:编辑,2:审批中,3:财务审批中,4:审批完成,5:生产中,6:生产完成/已出货)

	private Float totalPrice;// 合同总金额;
	private Integer totalGlasses;// 镜架总付数;
	private String otherPromise;// 其它约定
	private String qualityRequire;// 质量要求
	private String fittingRequire;// 配件要求
	private String memo;// 备注信息
	private String supplierLinkman;// 联系人

	private boolean deleteFlag;
	private Long customerId;

	public Long getStockId() {
		return stockId;
	}

	public void setStockId(Long stockId) {
		this.stockId = stockId;
	}

	public String getStockCode() {
		return stockCode;
	}

	public void setStockCode(String stockCode) {
		this.stockCode = stockCode;
	}

	public Integer getStockLevel() {
		return stockLevel;
	}

	public void setStockLevel(Integer stockLevel) {
		this.stockLevel = stockLevel;
	}

	public String getStockType() {
		return stockType;
	}

	public void setStockType(String stockType) {
		this.stockType = stockType;
	}

	public Date getStockDate() {
		return stockDate;
	}

	public void setStockDate(Date stockDate) {
		this.stockDate = stockDate;
	}

	public Factory getFactory() {
		return factory;
	}

	public void setFactory(Factory factory) {
		this.factory = factory;
	}

	public String getDeliveryDate() {
		return deliveryDate;
	}

	public void setDeliveryDate(String deliveryDate) {
		this.deliveryDate = deliveryDate;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Staff getCreator() {
		return creator;
	}

	public void setCreator(Staff creator) {
		this.creator = creator;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Long getModifiedBy() {
		return modifiedBy;
	}

	public void setModifiedBy(Long modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	public Staff getModifier() {
		return modifier;
	}

	public void setModifier(Staff modifier) {
		this.modifier = modifier;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public Long getConfirmId() {
		return confirmId;
	}

	public void setConfirmId(Long confirmId) {
		this.confirmId = confirmId;
	}

	public Confirm getConfirm() {
		return confirm;
	}

	public void setConfirm(Confirm confirm) {
		this.confirm = confirm;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Float getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Float totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Integer getTotalGlasses() {
		return totalGlasses;
	}

	public void setTotalGlasses(Integer totalGlasses) {
		this.totalGlasses = totalGlasses;
	}

	public String getOtherPromise() {
		return otherPromise;
	}

	public void setOtherPromise(String otherPromise) {
		this.otherPromise = otherPromise;
	}

	public String getQualityRequire() {
		return qualityRequire;
	}

	public void setQualityRequire(String qualityRequire) {
		this.qualityRequire = qualityRequire;
	}

	public String getFittingRequire() {
		return fittingRequire;
	}

	public void setFittingRequire(String fittingRequire) {
		this.fittingRequire = fittingRequire;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public boolean isDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(boolean deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public String getSupplierLinkman() {
		return supplierLinkman;
	}

	public void setSupplierLinkman(String supplierLinkman) {
		this.supplierLinkman = supplierLinkman;
	}

	public Long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}

	public String getStateName() {
		String stateName = "";
		if (AppConstant.BILL_STATE_SUBMITED == state) {
			stateName = "编辑中";
		} else if (AppConstant.BILL_STATE_PRE_CONFIRM == state) {
			stateName = "审批中";
		} else if (AppConstant.BILL_STATE_CONFIRMED == state) {
			stateName = "审批完成";
		} else if (AppConstant.BILL_STATE_DRAWBACK == state) {
			stateName = "已退单";
		}
		return stateName;
	}
	
	public String getStockLevelName() {
		String stockLevelName = "";
		if (AppConstant.STOCK_NEW == stockLevel) {
			stockLevelName = "新单";
		} else if (AppConstant.STOCK_OLD == stockLevel) {
			stockLevelName = "翻单";
		}else if (AppConstant.STOCK_BOTH == stockLevel) {
			stockLevelName = "新单+翻单";
		}  
		return stockLevelName;
	}
	
	public String getStockTypeName(){
		String stockTypeName = "";
		if (AppConstant.STOCK_ORDER_SPECIAL.equals(stockType)) {
			stockTypeName = "特级订单";
		} 
		if (AppConstant.STOCK_ORDER_URGENCY.equals(stockType)) {
			stockTypeName = "非常紧急";
		} 
		if (AppConstant.STOCK_ORDER_GENERAL.equals(stockType)) {
			stockTypeName = "一般紧急";
		} 
		if (AppConstant.STOCK_ORDER_NORMAL.equals(stockType)) {
			stockTypeName = "正常生产";
		} 
		if (AppConstant.STOCK_ORDER_LONG.equals(stockType)) {
			stockTypeName = "较长生产";
		}
		if (AppConstant.STOCK_ORDER_OVER.equals(stockType)) {
			stockTypeName = "超长生产";
		}    
		return stockTypeName;
	}
}
